const { Router } = require("express");

const router = Router();

module.exports = (request, response, next) => {
    response.sendResolve = (data, msg = "", code = 0) => {
        const result = {
            code: code,
            msg: msg,
            data: data
        };
        response.send(result);
    };

    response.sendReject = (code = -1, msg = "", data) => {
        const result = {
            code: code,
            msg: msg,
            data: data
        };
        response.send(result);
    }

    next();
}